<?php require_once('../../../core/import.php');?>
<?php User::Permission('SLIDE_EDIT'); ?>
<?php
	#获取参数
	$Class=strtoupper(Functions::UrlArgs('class'));			
	
	#生成文件
	$Data=DB::PGetRows('select * from slide where Class=? order by ID asc',array($Class));
	$XML='<?xml version="1.0" encoding="utf-8"?><bcaster autoPlayTime="3">';
	{
		foreach($Data as $Row)
		{
			$XML=$XML.'<item item_url="'.Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$Row['PictureFilename'].'" link="'.$Row['URL'].'" itemtitle=""></item>';
		}
	}
	$XML=$XML.'</bcaster>';	
	$fp=fopen(ROOT.'/data/slide/'.strtolower($Class).'.xml','w');
	{
		fwrite($fp,$XML);
		fclose($fp);
	}
	$fp=NULL;					
?>